package cs241.lab.world.DblLinkList;

public class DNode {
  protected World element;	// String element stored by a node
  protected DNode next, prev;	// Pointers to next and previous nodes
  /** Constructor that creates a node with given fields */
  public DNode(World e, DNode p, DNode n) {
    element = e;
    prev = p;
    next = n;
  }
  /** Returns the element of this node */
  public World getElement() { return element; }
  /** Returns the previous node of this node */
  public DNode getPrev() { return prev; }
  /** Returns the next node of this node */
  public DNode getNext() { return next; }
  /** Sets the element of this node */
  public void setElement(World newElem) { element = newElem; }
  /** Sets the previous node of this node */
  public void setPrev(DNode newPrev) { prev = newPrev; }
  /** Sets the next node of this node */
  public void setNext(DNode newNext) { next = newNext; }
}
